<?php

/**
* SPECIAL OFFERS
* Copyright (c) 2012 
* Author: Dmitriy Tovkach (ragvalod@gmail.com)
* @license		GNU/GPL
**/

// no direct access
defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
?>
<script type="text/javascript">
	Joomla.submitbutton = function(task)
	{
		if (task == 'promotion.cancel' || document.formvalidator.isValid(document.id('promotion-form'))) {
			<?php echo $this->form->getField('description')->save(); ?>
			Joomla.submitform(task, document.getElementById('promotion-form'));
		}
		else {
			alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED'));?>');
		}
	}
</script>

<form action="<?php echo JRoute::_('index.php?option=com_special&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="promotion-form" class="form-validate">
	<div class="width-100 fltlft">
		<fieldset class="adminform">
			<legend><?php echo empty($this->item->id) ? JText::_('COM_SPECIALS_NEW_SPECIAL') : JText::sprintf('COM_SPECIALS_EDIT_SPECIAL', $this->item->id); ?></legend>
			<ul class="adminformlist">
				<li><?php echo $this->form->getLabel('title'); ?>
				<?php echo $this->form->getInput('title'); ?></li>

				<li><?php echo $this->form->getLabel('concerns'); ?>
				<?php echo $this->form->getInput('concerns'); ?></li>

				

			

				<li><?php echo $this->form->getLabel('state'); ?>
				<?php echo $this->form->getInput('state'); ?></li>

				
				<li><?php echo $this->form->getLabel('featured'); ?>
				<?php echo $this->form->getInput('featured'); ?></li>
				
				<li><?php echo $this->form->getLabel('publish_up'); ?>
				<?php echo $this->form->getInput('publish_up'); ?></li>
				
				<li><?php echo $this->form->getLabel('publish_down'); ?>
				<?php echo $this->form->getInput('publish_down'); ?></li>
				

				<li><?php echo $this->form->getLabel('id'); ?>
				<?php echo $this->form->getInput('id'); ?></li>
			</ul>

			<div>
				<?php echo $this->form->getLabel('description'); ?>
				<div class="clr"></div>
				<?php echo $this->form->getInput('description'); ?>
			</div>
			
			<div>
				<?php echo $this->form->getLabel('descriptionevents'); ?>
				<div class="clr"></div>
				<?php echo $this->form->getInput('descriptionevents'); ?>
			</div>
			
			<div>
				<?php echo $this->form->getLabel('descriptionhome'); ?>
				<div class="clr"></div>
				<?php echo $this->form->getInput('descriptionhome'); ?>
			</div>
			<div class="clr"></div>
			<ul class="adminformlist">
				<li style="height:250px;margin-top:20px;"><?php echo $this->form->getLabel('imagebanner'); ?>
				<?php echo $this->form->getInput('imagebanner'); ?>
				<div class="button2-left">
					<div class="blank">
						<a onclick="$('relim1').set('src','<?php echo $this->baseurl.'/../'; ?>'+document.id('jform_imagebanner').value);return false;" href="#" title="Reload">Update Image</a>
					</div>
				</div>
				
				
				<div style="position:absolute;margin-top:40px;" ><img id="relim1" src="<?php echo $this->baseurl.'/../'.$this->item->imagebanner; ?>" /></div>
				
				</li>
			</ul>
			
			<ul class="adminformlist">
				<li style="height:180px;"><?php echo $this->form->getLabel('imagelist'); ?>
				<?php echo $this->form->getInput('imagelist'); ?>
				<div class="button2-left">
					<div class="blank">
						<a onclick="$('relim2').set('src','<?php echo $this->baseurl.'/../'; ?>'+document.id('jform_imagelist').value);return false;" href="#" title="Reload">Update Image</a>
					</div>
				</div>
				
				
				<div style="position:absolute;margin-top:40px;" ><img id="relim2" src="<?php echo $this->baseurl.'/../'.$this->item->imagelist; ?>" /></div>
				
				
				
				</li>
			</ul>
			
		</fieldset>
	</div>


	    <input type="hidden" name="task" value="" />
		<?php echo JHtml::_('form.token'); ?>
	<div class="clr"></div>
</form>
